<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateHouseTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('house', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('intermediary_id')->nullable()->comment('经纪人id');
            $table->string('house_name')->default('')->comment('房源名称');
            $table->string('house_area')->default('')->comment('房源小区名称');
            $table->tinyInteger('house_type')->comment('房源类型(0-新房，1-二手房，2-出租房)');
            $table->tinyInteger('house_province')->comment('房源所在省');
            $table->tinyInteger('house_city')->comment('房源所在市');
            $table->tinyInteger('house_region')->comment('房源所在区');
            $table->string('house_address')->default('')->comment('房源详细地址');
            $table->string('longitude')->default('')->comment('经度');
            $table->string('latitude')->default('')->comment('纬度');
            $table->tinyInteger('house_direction')->comment('房源朝向');
            $table->decimal('house_build_area')->comment('房源建筑面积');
            $table->decimal('house_use_area')->comment('房源使用面积');
            $table->tinyInteger('house_year')->comment('房源建筑年代');
            $table->tinyInteger('house_floor')->comment('房源楼层');
            $table->tinyInteger('house_room')->comment('几室几厅几卫');
            $table->string('house_img')->default('')->comment('房源封面图片');
            $table->tinyInteger('house_date_type')->comment('售/租期方式');
            $table->tinyInteger('house_price_range')->comment('售/租金范围');
            $table->string('house_config')->default('')->comment('房源配套设施');
            $table->string('house_label')->default('')->comment('房源标签');
            $table->integer('house_owner')->comment('业主');
            $table->tinyInteger('house_status')->default('0')->comment('房源状态(0-待审核 1-审核不通过 2-审核通过)');
            $table->text('house_desc')->comment('房源描述');
            $table->tinyInteger('house_property_type')->nullable()->comment('房产类型');
            $table->enum('is_recommend')->default('0')->comment('是否推荐(0-否 1-是)');
            $table->decimal('pay_money')->default('0.00')->comment('支付金额');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('house');
    }
}
